package sudoku;

import evo.IInstance;
import evo.IInstanceBuilder;

public class SudokuBuilder implements IInstanceBuilder {

	private SudokuProblem _prob;

	public SudokuBuilder(SudokuProblem prob)
	{
		this._prob = prob;
	}
	
	@Override
	public IInstance createRandom() {
		SudokuSolution sol = new SudokuSolution(this._prob);
		sol.randomize();
		return sol;
	}

	@Override
	public IInstance[] createRandom(int n) {
		IInstance[] sols = new SudokuSolution[n];
		for (int i = 0; i < n; i++) {
			sols[i] = this.createRandom();
		}
		return sols;
	}

}
